import java.util.Scanner;

public class Test2_8 {
    public static void main(String[] args) {
        // Obtain the total milliseconds since midnight, Jan 1, 1070
        long totalMilliseconds = System.currentTimeMillis();

        // Obtain the total seconds since midnight, Jan 1, 1070
        long totalSeconds = totalMilliseconds / 1000;

        // Compute the current second in the minute in the hour
        long currentSecond = totalSeconds % 60;

        // Obtain the total minutes
        long totalMinutes = totalSeconds / 60;

        // Compute the current minute in the hour
        long currentMinute = totalMinutes % 60;

        // Obtain the total hours
        long totalHours = totalMinutes / 60;

        // Compute the current hour
        long currentHour = totalHours % 24;

        /** 修改 **/
        System.out.print("Enter the time zone offset to GMT:");
        Scanner input = new Scanner(System.in);
        int offset = input.nextInt();
        currentHour = (currentHour + offset) % 24; // currentHour + offset如果小于0得到的结果会不正确，对24取余可以得到正确答案
        /** 修改 **/

        // Display results
        System.out.println("Current time is " + currentHour + ":" + currentMinute + ":" + currentSecond + " GMT");
    }
}
